package org.lionel.leetcode;

import java.util.Arrays;

public class TwoSum {
    public int[] twoSum(int[] nums, int target) {
        int len = nums.length;
        for (int i = 0;i<len-1;i++){
            for (int j = i+1;j<len;j++){
                if (nums[i]+nums[j]==target){
                    return new int[]{i,j};
                }
            }
        }
        return new int[0];

    }

    public static void main(String[] args) {
        TwoSum twoSum = new TwoSum();
        int [] nums = {2,7,11,15};
        int[] a = twoSum.twoSum(nums, 9);
        System.out.println(Arrays.toString(a));

    }
}
